<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="/WEB-INF/stripes-security.tld" prefix="ss" %>
<s:layout-definition>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><c:out value="${title}" /></title>
            <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/styles.css"/>
            <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico"/>
        </head>
        <body>
            <div id="header">
                <div class="content">
                    <h1 id="logo"><s:link href="/"><span>Creatures Hunting</span></s:link></h1>
                    <ul class="navcontainer" id="scnd-navigation">
                        <!--<li><a href="#">pa 165</a></li>-->
                        <li><a href="http://code.google.com/p/creatures-hunting/">GOOGLE CODE</a></li>
                    </ul>
                </div>
            </div>

            <div id="main">
                <div class="head">
                    <div class="content">
                        <s:useActionBean var="applicationAB" beanclass="cz.muni.fi.pa165.creatures.web.ApplicationActionBean"/>
                        <c:choose>
                            <c:when test="${applicationAB.context.user.name != null}">
                                <ul class="navcontainer" id="main-navigation">
                                    <li><s:link href="/regions/all"><f:message key="regions"/></s:link></li>
                                    <li><s:link href="/creatures/all"><f:message key="creatures"/></s:link></li>
                                    <li><s:link href="/types/all"><f:message key="creature_types"/></s:link></li>
                                    <li><s:link href="/weapons/all"><f:message key="weapons"/></s:link></li>
                                    <li><s:link href="/logout"><f:message key="logout"/> ${applicationAB.context.user.name}</s:link></li>
                                </ul>
                            </c:when>
                            <c:otherwise>
                                <ul class="navcontainer" id="main-navigation">
                                    <li><s:link href="/register.jsp"><f:message key="register"/></s:link></li>
                                    <li><s:link href="/login.jsp"><f:message key="login"/></s:link></li>
                                </ul>
                            </c:otherwise>
                        </c:choose>  
                        <s:layout-component name="menu"/>
                    </div>
                </div>  

                <s:layout-component name="main_content"/>
                <div class="footer">
                    <div class="content">
                        <p>school project from <a href="http://fi.muni.cz">fi.muni.cz</a> for PA165 &ndash; Tomáš Hájek, Richard Hůlek, Štefan Miklošovič, Ondřej Vojtíšek</p>
                    </div>
                </div>
            </div>
        </body>
    </html>
</s:layout-definition>